﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Report.WebApi.Interfaces;
using Report.WebApi.Models;
using Report.WebApi.Models.ResponseModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Report.WebApi.Controllers
{
    [Route("api/wxcb")]
    [ApiController]
    public class QueryWXCBController : ControllerBase
    {
        private readonly IQueryWXFYService _wxfyService;
        private readonly IQueryWXLBFYService _wxlbfyService;
        private readonly IQueryWXLXService _wxlxfyService;
        private readonly IQueryDPBQService _dpbqService;
        private readonly IQueryDPLXService _dplxService;
        private readonly IQueryBrandService _brandService;
        private readonly IQueryCBLXService _cblxService;
        private readonly IQueryZZService _zzService;
        private readonly IQueryWXWTYWFLService _wxwtywflService;
        public QueryWXCBController(IQueryWXFYService wxffxService,
            IQueryWXLBFYService wxlbfyService,
            IQueryWXLXService wxlxService,
            IQueryDPBQService dpbqService,
            IQueryDPLXService dplxService,
            IQueryBrandService brandService,
            IQueryCBLXService cblxService,
            IQueryZZService zzService,
            IQueryWXWTYWFLService wxwtywflService)
        {
            _wxfyService = wxffxService;
            _wxlbfyService = wxlbfyService;
            _wxlxfyService = wxlxService;
            _dpbqService = dpbqService;
            _dplxService = dplxService;
            _brandService = brandService;
            _cblxService = cblxService;
            _zzService = zzService;
            _wxwtywflService = wxwtywflService;
        }

        /// <summary>
        /// 维修费分析
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("wxffx")]
        public async Task<WXFYResponse> QueryWXFY([FromBody] QueryRequestModel request)
        {
            return await _wxfyService.GetHomePageData(request);
        }

        /// <summary>
        /// 维修类别费用
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("wxlbfy")]
        public async Task<List<WXLBFYResponse>> QueryWXLBFY([FromBody] QueryRequestModel request)
        {
            return await _wxlbfyService.GetHomePageData(request);
        }
        /// <summary>
        /// 维修类型
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("wxlx")]
        public async Task<List<WXLXFYResponse>> QueryWXLX([FromBody] QueryRequestModel request)
        {
            return await _wxlxfyService.GetHomePageData(request);
        }
        /// <summary>
        /// 按店铺标签
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("dpbq")]
        public async Task<List<DPBQResponse>> QueryDPBQ([FromBody] QueryRequestModel request)
        {
            return await _dpbqService.GetHomePageData(request);
        }
        /// <summary>
        /// 店铺类型
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("dplx")]
        public async Task<List<DPLXResponse>> QueryDPLX([FromBody] QueryRequestModel request)
        {
            return await _dplxService.GetHomePageData(request);
        }
        /// <summary>
        /// 按品牌
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("pp")]
        public async Task<List<BrandResponse>> QueryPP([FromBody] QueryRequestModel request)
        {
            return await _brandService.GetHomePageData(request);
        }

        /// <summary>
        /// 成本类型
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("cblx")]
        public async Task<List<CBLXResponse>> QueryCBLX([FromBody] QueryRequestModel request)
        {
            return await _cblxService.GetHomePageData(request);
        }



        /// <summary>
        /// 按组织分析
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("zz")]
        public async Task<List<ZZResponse>> QueryZZ([FromBody] QueryDomainRequestModel request)
        {
            return await _zzService.GetHomePageData(request);
        }

        /// <summary>
        /// 维修问题业务分类
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("wxwtywfl")]
        public async Task<List<WXWTYWFLResponse>> QueryWXWTYEFL([FromBody] QueryRequestModel request)
        {
            return await _wxwtywflService.GetHomePageData(request);
        }

    }
}
